04-Convert to Float.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet

pocket_money= input("So how much do you have left? ")
answer = float(pocket_money) -5.50 #converts the variable pocket_money to a float data type and subtracts £5.50 from it!
print("Well, you owe me £5.50, so that leaves you with   £", answer)
                    

Try it yourself